import request from '@/utils/requests'

//注册接口
export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })
// 登录接口
export const userLoginService = ({ username, password }) => {
  return request.post('/api/login', { username, password })
}
// 用户信息接口
export const userInfoService = () => {
  return request.get('/my/userinfo')
}
// 更新个人信息
export const userUpdataService = (data) => {
  return request.put('/my/userinfo', data)
}
// 更换用户头像
export const userAvatarService = (avatar) => {
  return request.post('/my/update/avatar', { avatar })
}
// 修改用户密码
export const userUpdataPassword = (data) => {
  return request.post('/my/updatepwd', data)
}
